package com.center.growcenterserver.controller;

import com.center.growcenterserver.common.R;
import com.center.growcenterserver.model.request.AdminRequest;
import com.center.growcenterserver.service.AdminService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * 管理员的控制类，包含了判断登录的方法
 */
@Slf4j
@RestController
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private AdminService adminService;

    // 判断是否登录成功
    @PostMapping("/login/status")
    public R loginStatus(@RequestBody AdminRequest adminRequest, HttpSession session) {
        R result = adminService.verityPasswd(adminRequest, session);
        return result;
    }







}
